package com.neusoft.neuiotms.dcom.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.bizcore.activiti.business.ActBusiness;
import com.neusoft.neuiotms.dcom.service.incident.IncidentRegisterService;
import com.neusoft.neuiotms.dcom.service.malfunction.MalfunctionApplyFormService;

@Service
public class ActBusinessService implements ActBusiness {

    @Autowired
    private IncidentRegisterService incidentRegisterService;

    @Autowired
    private MalfunctionApplyFormService malfunctionApplyFormService;

    @Override
    public void deleteBusinessData(final String formKey, final String workNum) {

        switch (formKey) {
        case "EVENTDJFF": // 事件的登记分发
            this.incidentRegisterService.deleteByWorkNum(workNum);
            break;
        case "MALFUNCTIONAPPLYFORM": // 故障流程的创建节点
            this.malfunctionApplyFormService.deleteByWorkNum(workNum);
            break;
        default:
            break;
        }
    }

}
